let product = {
    bannerImg: $("#banner-img"), // banner图片
    proCategory: $("#product-tab"), // 产品分类
    proCategoryChild: $("#product-child"), // 产品子分类
    switchPro() {
        this.proCategory.on("click", "a", function (e) {
            e.preventDefault()
            let $this = $(this)
            let id = $this.attr("href")
            $this.addClass("active").parent("li").siblings().children("a").removeClass("active")
            $(id).css("display", "block").siblings().css("display", "none")
            if (id === "#gps") {
                product.getGpsData()
            } else if (id === "#bluetooth") {
                product.getBluetoothData()
            }
        })
        this.proCategoryChild.on("click", "li", function (e) {
            e.preventDefault()
            let $this = $(this)
            $this.addClass("active").siblings().removeClass("active")
        })
    },
    getGpsData() {
        /**
         * 获取gps数据
         */
    },
    getBluetoothData() {
        /**
         * 获取Bluetooth数据
         */
    }
}

product.switchPro()